/*****************************************************************************/
/**
*
* @file bsp_systick.c
*
* User defined functions about gpios of stm32.
* Target device: STM32F103RET6.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who    Date   	Changes
* ----- ---- ---------- -------------------------------------------------------
* 0.01  abu  02/03/2020 Created
* </pre>
*
*------------------------------------------------------------------------------
* Author:	abu
*					E-mail:	abu_liu@opencores.org
*------------------------------------------------------------------------------
*
******************************************************************************/

/***************************** Include Files *********************************/
#include "bsp_systick.h"

/************************** Function Prototypes ******************************/

/*****************************************************************************/
/**
*
* @brief	Initialise systick.
*
* @param	None.
* @param  None.	
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
void SysTick_Init(void)
{
	if(SysTick_Config(SystemCoreClock/100000))
		while(1);
}

/*****************************************************************************/
/**
*
* @brief	Systick interrupt handler.
*
* @param	None.
* @param  None.	
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
void SysTick_Handler(void)
{
	static uint32_t systick_cnt = 100000;
	
	if(systick_cnt != 0)
		systick_cnt = systick_cnt - 1;
	else
	{
		Led_Red_Toggle();
		systick_cnt = 100000;
	}
}
